﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace VehicleManagement.Models
{
    public class Message
    {

        //----------------信息提醒-------------------
        //create table [Message]
        //(
        //MessageID int IDENTITY(1,1) primary key,
        //ReceiverID int,
        //ReceiverRole varchar(12) not null,
        //ReceiverName varchar(18) not null,
        //SenderID int,
        //SenderRole varchar(12) not null,
        //SenderName varchar(18) not null,
        //SendTime DateTime default(getdate()),
        //MessageText varchar(1000) not null,
        //IsChecked bit default(0),
        //Remark varchar(100)
        //)

        public int MessageID { get; set; }

        public int ReceiverID { get; set; }

        [DisplayName("接收人角色")]
        [Required(ErrorMessage = "角色不能为空")]
        [StringLength(12, ErrorMessage = "角色不能超过12位")]
        public string ReceiverRole { get; set; }

        [DisplayName("接收人姓名")]
        [Required(ErrorMessage = "姓名不能为空")]
        [StringLength(18, ErrorMessage = "姓名不能超过18位")]
        public string ReceiverName { get; set; }

        public int SenderID { get; set; }

        [DisplayName("发送人角色")]
        public string SenderRole { get; set; }

        [DisplayName("发送人姓名")]
        public string SenderName { get; set; }

        [DisplayName("发送时间")]
        public DateTime SendTime { get; set; }

        [DisplayName("提醒内容")]
        [Required(ErrorMessage = "内容不能为空")]
        [StringLength(1000, ErrorMessage = "内容不能超过1000位")]
        public string MessageText { get; set; }


        [DisplayName("有无阅读")]
        public bool IsChecked { get; set; }

        [DisplayName("备注")]
        [StringLength(100, ErrorMessage = "备注不能超过100位")]
        public string Remark { get; set; }

        [DisplayName("公司名称")]
        public virtual string CompanyName { get; set; }
    }
}